﻿/**************************************************************************
创建时间:	2020/5/13 9:42:19    
作	  者:	张存
邮 	  箱:	zhangcunliang@126.com

描	述：
记	录：
***************************************************************************/
using System;
using System.ComponentModel;
using System.Windows.Forms;

namespace ASmile.Win.Controls
{
    public class EditCheckBox: CheckBox, IEditDCM
    {
        object _ValueItem;

        /// <summary>
        /// 输入框的值
        /// </summary>
        [Browsable(false)]
        public object ValueItem
        {
            set
            {
                _ValueItem = value;
                IsValueChanged = true;
            }
            get
            {
                return _ValueItem;
            }
        }

        [Browsable(false)]
        public object DisplayItem
        {
            get
            {
                return this.Checked;
            }
            set
            {
                Checked = Convert.ToBoolean(value);
            }
        }

        [Browsable(false)]
        public bool IsValueChanged { get; private set; }

        [Browsable(false)]
        public bool IsDisplayChanged { get;} = true;

        public void SetDefault()
        {
            ValueItem = null;
            IsValueChanged = false;
        }
    }
}